CC     = g++
CFLAGS = `freetype-config --cflags` -I/usr/local/include  -L/usr/local/lib -lpng -lpngwriter -lz -lfreetype -O3

all: mk_image mk_buddhabrot_file

mk_buddhabrot_file: mk_buddhabrot_file.cc
	$(CC) mk_buddhabrot_file.cc -o mk_buddhabrot_file

mk_image: mk_image.cc rotation.cc rotation.h
	$(CC) mk_image.cc rotation.cc -o mk_image $(CFLAGS)

sort: s_out.txt

s_out.txt: out.txt
	sort -k 1n,1 -k2n,2 -k3n,3 -k4n,4  out.txt > s_out.txt

clean:
	rm mk_buddhabrot_file mk_image

jpeg: $(patsubst %.png,%.jpg,$(wildcard *.png))

jpg: jpeg

%.jpg: %.png
	convert $< $@
